package com.mysoft.gfyx.marketdevelop.controller.dto.advancesearch;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.mysoft.framework.common.util.MappingUtil;
import com.mysoft.gfyx.marketdevelop.dao.entity.AdvanceSearchField;
import lombok.Data;

import java.util.ArrayList;
import java.util.List;
import java.util.UUID;

@Data
public class SubGroupDto {
    private UUID advanceSearchFieldGroupGUID;
    private String groupName;
    private UUID pid;
    private List<AdvanceSearchFieldDto> fields;

    public void setAdvanceSearchField(List<AdvanceSearchField> advanceSearchFieldList) {
//        List<AdvanceSearchFieldDto> advanceSearchFieldDtoList = new ArrayList<>();
//        for (AdvanceSearchField advanceSearchField : advanceSearchFieldList) {
//            if (!this.getAdvanceSearchFieldGroupGUID().equals(advanceSearchField.getAdvanceSearchFieldGroupGUID())) {
//                continue;
//            }
//            AdvanceSearchFieldDto advanceSearchFieldDto = MappingUtil.getSimpleMapperFacade().map(advanceSearchField, AdvanceSearchFieldDto.class);
//            advanceSearchFieldDto.setJsonConfig(JSON.parseObject(advanceSearchFieldDto.getConfig()));
//            advanceSearchFieldDtoList.add(advanceSearchFieldDto);
//        }
//        this.setFields(advanceSearchFieldDtoList);
    }
}
